#ifndef _selector_h_
#define _selector_h_
#include"PlatformAPI.h"
#include<vector>

class Selector
{
public:
	Selector();

	bool					Poll(int millsecond);
	void					Register(SOCKET socket);
	void					UnRegister(SOCKET socket);

	bool					CanRead(SOCKET socket);
	bool					CanWrite(SOCKET socket);
	bool					IsException(SOCKET socket);
private:
	std::vector<SOCKET>		m_sockets;
	fd_set					m_readset;
	fd_set					m_writeset;
	fd_set					m_exceptionset;
};

#endif
